home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_bas / t2win_32.zip / _MEM.FRM < prev    next >
Text File  |  1996-05-14  |  6KB  |  222 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMem 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Memory status"
  5.    ClientHeight    =   4845
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   7485
  9.    Height          =   5250
  10.    Left            =   1830
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   4845
  14.    ScaleWidth      =   7485
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2925
  17.    Width           =   7605
  18.    Begin Threed.SSPanel SSPanel1 
  19.       Align           =   1  'Align Top
  20.       Height          =   480
  21.       Left            =   0
  22.       TabIndex        =   1
  23.       Top             =   0
  24.       Width           =   7485
  25.       _Version        =   65536
  26.       _ExtentX        =   13203
  27.       _ExtentY        =   847
  28.       _StockProps     =   15
  29.       ForeColor       =   -2147483640
  30.       BackColor       =   12632256
  31.       Begin VB.ComboBox cmb_Function 
  32.          Height          =   315
  33.          Left            =   1365
  34.          TabIndex        =   2
  35.          Top             =   90
  36.          Width           =   4785
  37.       End
  38.       Begin Threed.SSCommand cmdNP 
  39.          Height          =   300
  40.          Index           =   1
  41.          Left            =   7140
  42.          TabIndex        =   6
  43.          Top             =   90
  44.          Width           =   255
  45.          _Version        =   65536
  46.          _ExtentX        =   450
  47.          _ExtentY        =   529
  48.          _StockProps     =   78
  49.          Caption         =   ">"
  50.          BevelWidth      =   1
  51.          Font3D          =   3
  52.          RoundedCorners  =   0   'False
  53.          Outline         =   0   'False
  54.       End
  55.       Begin Threed.SSCommand cmdNP 
  56.          Height          =   300
  57.          Index           =   0
  58.          Left            =   6300
  59.          TabIndex        =   5
  60.          Top             =   90
  61.          Width           =   255
  62.          _Version        =   65536
  63.          _ExtentX        =   450
  64.          _ExtentY        =   529
  65.          _StockProps     =   78
  66.          Caption         =   "<"
  67.          BevelWidth      =   1
  68.          Font3D          =   3
  69.          RoundedCorners  =   0   'False
  70.          Outline         =   0   'False
  71.       End
  72.       Begin VB.Label Label2 
  73.          Caption         =   "&Select a function"
  74.          Height          =   255
  75.          Left            =   90
  76.          TabIndex        =   4
  77.          Top             =   120
  78.          Width           =   1275
  79.       End
  80.       Begin Threed.SSCommand SSCommand1 
  81.          Default         =   -1  'True
  82.          Height          =   300
  83.          Left            =   6615
  84.          TabIndex        =   3
  85.          Top             =   90
  86.          Width           =   465
  87.          _Version        =   65536
  88.          _ExtentX        =   820
  89.          _ExtentY        =   529
  90.          _StockProps     =   78
  91.          Caption         =   "&Go"
  92.          BevelWidth      =   1
  93.          RoundedCorners  =   0   'False
  94.          Outline         =   0   'False
  95.       End
  96.    End
  97.    Begin VB.Label lbl_Result 
  98.       Appearance      =   0  'Flat
  99.       BackColor       =   &H80000005&
  100.       BackStyle       =   0  'Transparent
  101.       ForeColor       =   &H80000008&
  102.       Height          =   4110
  103.       Left            =   90
  104.       TabIndex        =   0
  105.       Top             =   630
  106.       Width           =   7305
  107.    End
  108. End
  109. Attribute VB_Name = "frmMem"
  110. Attribute VB_Creatable = False
  111. Attribute VB_Exposed = False
  112. Option Explicit
  113. Option Base 1
  114.  
  115. Private Const Iteration = 250
  116.  
  117. Dim IsLoaded         As Integer
  118.  
  119. Dim TimerStartOk     As Integer
  120. Dim TimerCloseOk     As Integer
  121.  
  122. Dim TimerHandle      As Integer
  123. Dim TimerValue       As Long
  124.  
  125. Private Sub cmdNP_Click(Index As Integer)
  126.  
  127.    Call sub_NextPrev(cmb_Function, Index)
  128.  
  129. End Sub
  130.  
  131.  
  132. Private Sub cmb_Function_Click()
  133.    
  134.    If (IsLoaded = False) Then Exit Sub
  135.    
  136.    Call cDisableFI(mdiT2W.Picture1)
  137.    
  138.    lbl_Result = ""
  139.    
  140.    DoEvents
  141.    
  142.    Select Case cmb_Function.ListIndex
  143.       Case 0
  144.          Call TestMemoryStatus
  145.    End Select
  146.  
  147.    DoEvents
  148.    Call cEnableFI(mdiT2W.Picture1)
  149.    
  150. End Sub
  151.  
  152.  
  153. Private Sub Form_Activate()
  154.  
  155.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  156.  
  157. End Sub
  158.  
  159. Private Sub Form_Load()
  160.  
  161.    IsLoaded = False
  162.    
  163.    Show
  164.  
  165.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_mem.t2w")
  166.    
  167.    IsLoaded = True
  168.    
  169. End Sub
  170.  
  171. Private Sub SSCommand1_Click()
  172.    
  173.    Call cmb_Function_Click
  174.    
  175. End Sub
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183. Private Sub TestMemoryStatus()
  184.  
  185.    Dim intResult        As Integer
  186.    Dim strResult        As String
  187.    Dim strDisplay       As String
  188.    
  189.    Dim i                As Integer
  190.    
  191.    Dim MSS              As tagMEMORYSTATUS
  192.    
  193.    strResult = ""
  194.    strDisplay = ""
  195.    
  196.    Call cMemoryStatus(MSS)
  197.    
  198.    strDisplay = strDisplay & "dwMemoryLoad = " & MSS.dwMemoryLoad & vbCrLf
  199.    strDisplay = strDisplay & "dwTotalPhys = " & MSS.dwTotalPhys & vbCrLf
  200.    strDisplay = strDisplay & "dwAvailPhys = " & MSS.dwAvailPhys & vbCrLf
  201.    strDisplay = strDisplay & "dwTotalPageFile = " & MSS.dwTotalPageFile & vbCrLf
  202.    strDisplay = strDisplay & "dwAvailPageFile = " & MSS.dwAvailPageFile & vbCrLf
  203.    strDisplay = strDisplay & "dwTotalVirtual = " & MSS.dwTotalVirtual & vbCrLf
  204.    strDisplay = strDisplay & "dwAvailVirtual = " & MSS.dwAvailVirtual & vbCrLf
  205.      
  206.    lbl_Result = strDisplay
  207.  
  208.    'time the function
  209.  
  210.    TimerHandle = cTimerOpen()
  211.    TimerStartOk = cTimerStart(TimerHandle)
  212.    
  213.    For i = 1 To Iteration
  214.       Call cMemoryStatus(MSS)
  215.    Next i
  216.    
  217.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  218.    
  219.    TimerCloseOk = cTimerClose(TimerHandle)
  220.  
  221. End Sub
  222.